package com.wiscamp.ninechapters.problems.infrastructure.converters;

import com.wiscamp.ninechapters.problems.domain.models.exams.PaperSection;
import com.wiscamp.ninechapters.problems.infrastructure.po.exams.PaperSectionPO;
import com.wiscamp.ninechapters.problems.infrastructure.po.exams.PaperSectionView;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface PaperSectionConverter {
    PaperSectionConverter Instance = Mappers.getMapper(PaperSectionConverter.class);

    PaperSectionPO toPaperSectionPO(PaperSection entity);

    PaperSectionPO toPaperSectionPO(PaperSection entity, @MappingTarget PaperSectionPO po);

    PaperSection toPaperSection(PaperSectionPO po);

    PaperSection toPaperSectionByView(PaperSectionView view);
}
